home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / cbibcode.arc / STLNSTL.C < prev    next >
Encoding:
C/C++ Source or Header  |  1991-08-05  |  783 b   |  28 lines

  1. #include <graphics.h>
  2.  
  3. /* Define the line styles */
  4. unsigned linestyle[16] =
  5. {1, 3, 7, 0xf, 0x1f, 0x3f, 0x7f, 0xff,
  6.  0x1ff, 0x3ff, 0x7ff, 0xfff, 0x1fff, 0x3fff, 0x7fff,
  7.  0xffff};
  8. main()
  9. {
  10.    int graphdriver = DETECT, graphmode, i, y = 30;
  11.  
  12. /* Detect and initialize graphics system */
  13.    initgraph(&graphdriver, &graphmode, "c:\\turboc");
  14.    outtextxy(10,10, "Demonstrating different line styles:");
  15.    setcolor(RED);
  16.    for (i=0; i<16; i++)
  17.    {
  18. /* Select a line style from the array of style styles */
  19.       setlinestyle(USERBIT_LINE, linestyle[i], NORM_WIDTH);
  20.       moveto(0,y);
  21.       lineto(500,y);
  22.       y += 10;
  23.    }
  24. /* Give user a chance to see the result */
  25.    outtextxy(10, getmaxy() - 50, "Press any key to exit");
  26.    getch();
  27.    closegraph();
  28. }